

async function queryPageData(connection, sql, options) {
    const conn = await connection.getConnection()
    const data = await conn.query(sql, options)
    const count = await conn.query('select found_rows() as count')

    await conn.release()
    return {data, count: count[0].count}
}

module.exports = queryPageData;
